import requests

url = "http://httpbin.org/post"

f ={
    "file":open("d:/1.txt","r")
}

r = requests.post(url,files=f)
print(f)


import requests

url = "http://httpbin.org/post"

f ={
    "file":open("d:/Snipaste_2022-09-05_14-40-21.png","rb")
}

r = requests.post(url,files=f)
print(f)